<?php 
session_start();
if(!isset($_SESSION["login"]) || $_SESSION["login"] == 0)
{
	
 header("Location: login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/templateadmin.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Place your description here" />
<meta name="keywords" content="put, your, keyword, here" />
<meta name="author" content="Templates.com - website templates provider" />
<link href="css/styleAdmin.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Administrator</title>
<script  type="text/javascript">
function searchGameAdminjv()
{
	textSrc = document.getElementById("txtSrcGame").value;
	type = document.getElementById("mnType").value;
	searchGameAdmin(textSrc,type,1);
	
}
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script src="../js/jquery.min.js" language="javascript"></script>
<script type="text/javascript">
$(document).ready(function() {

    $("ul#topnav li").hover(function() { //sự kiện khi đưa chuột vào menu
        //Add background color and image on hovered list item
        $(this).find("span").show(); //hiễn thị menu cấp 2
    } , function() { //on hover out...
        $(this).css({ 'background' : 'none'}); 
        $(this).find("span").hide(); //ẩn menu cấp 2
    });

});
</script>  
<script>
function checkgo()
{
	if(isNaN(document.gopage.go.value))
	return false;
}

</script>
<?php
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
 ?>
</head>

<body id="page1">
<div id="loadingpage" style="		
	text-align:center;
	position:fixed;
  z-index: 100;  
  top:49%; 
  left:49%;
  background-color:#A0A0A4;
  opacity:0.7;
  display:none;
  " >
<img src="../img/loadingpage.gif" width="55px" height="55px"  />
</div>

<div class="tail-top">
	<div class="tail-bottom">
		<div class="body-bg">
			<!-- HEADER -->
			<div id="header">
				<div class="extra"><img src="images/header-img.png" alt="" /></div>
				<div class="row-1">
					
					<div class="fright">
                    <?php
                    	if(isset($_SESSION["login"]) && $_SESSION["login"] == 1)
                        {
                            echo ' <span>Hi! '.$_SESSION["user"]. '. <a href="process/processLogin.php" style="text-decoration:none;" >log out</a></span>';
                       
                        }
                        
                        
                        ?>
                    </div>
				</div>
				<div class="row-2">
					<ul id="topnav">
						<li class="m1"><a id="m1" href="home.php">Game Manager</a></li>
						<li class="m2"><a id="m2" href="categories.php">Categories Manager</a></li>
						<li class="m3" style="height:110px;" ><a id="m3" href="upgame.php">Upload Game</a><span style="display:none;"><a style="background:none; padding:0;"   href="customupgame.php">Custom Game</a></span></li>
						<li class="m4"><a id="m4" href="bills.php">Bills Manager</a></li>
						<li class="m5"><a id="m5" href="banner.php">Banner Manager</a></li>
                        <li class="m6" ><a id="m6" href="request.php">Request Manager</a></li>
						<li class="m7" style="display:none;"><a id="m6" href="sitemap.html">Sitemap</a></li>
					</ul>
				</div>
				
			</div>
			<!-- CONTENT -->
			<div id="content">
				<div class="tail-right">
					<div class="wrapper">
						<div class="col-1"><!-- InstanceBeginEditable name="col1" -->
                       
<link href="css/edit_box.css" rel="stylesheet" type="text/css" />

<table width="80%" border="1" style="border-radius: 7px 7px 7px 7px; margin-left:10%; margin-top:40px;" >
 <tr><td align="center"><div >
<input name="txtSrcGame" id="txtSrcGame" type="text" style="border-radius:7px 7px 7px 7px;" onkeydown="if(event.keyCode==13) searchGameAdminjv();" /> <select name="menu" id="mnType" style="width:100px;">
           <option value="0" selected="selected">All</option>
            <?php
			include_once("../DataProvider.php");
			$sql = "select * from tbl_categories";
			$result = DataProvider::ExecuteQuery($sql);
			while($row = mysql_fetch_array($result))
			{
				echo'<option value="'.$row["idCategories"].'">'.$row["categories"].'</option>';
			}
			?></select> <input name="btnSearch" type="button" onclick="searchGameAdminjv()"  value="Tìm" style="border-radius:7px 7px 7px 7px;" /></div></td></tr>
<tr><td><table border="1" style=" border-left:none; border-right:none; border-radius: 7px 7px 7px 7px;" id="tablegame"></table></td></tr>
</table>
<div id="edit-box" class="edit-popup" style="display:none;">

        <a class="close"  href="#" onclick="javascript:exit()"><img alt="Close" title="Close Window" class="btn_close" src="images/close_pop.png"></a>
        <span style="color:#FFF; margin-left:60px;" >Game Editer</span>
          <form id="Edit" name="Edit-popup" action="process/processUpdateGame.php" class="Edit" method="post">
                <fieldset class="textbox">
                <input type="hidden" value="" name="idGame" id="idGame">
            	<label class="">
                <span>Tên Game:</span>
                <input type="text" placeholder="Tên Game" autocomplete="on" value="" name="gamename" id="gamename">
                </label>
                
                <label class="">
                <span>Giá</span>
                <input type="text" placeholder="Giá" value="" name="price" id="price">
                </label>
                
                <label class="">
                <span>Size</span>
                <input type="text" placeholder="Size" value="" name="size" id="size">
                </label>
                
                <label class="">
                <span>Thể Loại</span>
                <select name="menu" id="cbxType" style="width:auto;">
           
            <?php
			include_once("../DataProvider.php");
			$sql = "select * from tbl_categories";
			$result = DataProvider::ExecuteQuery($sql);
			while($row = mysql_fetch_array($result))
			{
				echo'<option value="'.$row["idCategories"].'">'.$row["categories"].'</option>';
			}
			?>
        </select>
                </label>
                
                <label class="">
                <span>Device</span>
                 
                <input type="radio" name="dev" id="devIPhone" value="1" style="width:auto;" /><a>&nbsp;IPhone</a></label><label>
               <input type="radio" name="dev" id="devIPad" value="2" style="width:auto"  /><a>&nbsp;IPad</a></label><label>
                <input type="radio" name="dev" id="devAll" value="3" style="width:auto" /><a>&nbsp;IPhone& Ipad</a></label>
               
                <label>
                <input type="checkbox" name="Hot" id="Hot" value="1" style="width:auto" /><a>&nbsp;Game Hot</a></label>
                <button type="submit" onclick="return checkSubmit()" class="submit button" onclick="">Lưu</button>
               
                </fieldset>
          </form>
	
      
         
</div>
<div id="request"></div>
 <script src="js/admin.js" type="text/javascript"></script>
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function($) {
    $("#m1").attr("class","active");
	loadGameAdmin(1);
});
</script>
<script type="text/javascript">

</script><!-- InstanceEndEditable -->
							
				      </div>
					</div>
				</div>
			</div>
			<!-- FOOTER -->
			<div id="footer">
				<div class="indent">
					<div class="fleft">
<div class="vlinks"><a href="http://www.webdesign.org">Web design</a> by <a title="Free Templates Online" href="http://www.freetemplatesonline.com">Free Templates</a> Online</div></div>
					<div class="fright">Copyright - HTT</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript"> 
showLoadingPage();
function showLoadingPage()
{
	$("#loadingpage").show();
} 
Cufon.now(); </script>
</body>
<!-- InstanceEnd --></html>
